﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Koossery.MVCwin.Actions.itf;
using Koossery.MVCwin.Controller.itf;
using Koossery.MVCwin.Properties;

namespace Koossery.MVCwin.Filters.context
{
	/// <author>Mohamadou Yacoubou</author>
	/// <summary>
	/// The context of the pre result execution attribute
	/// </summary>
	public class ResultExecutingContext : FilterContext
	{
		#region Constructors

		public ResultExecutingContext(IController controller, IActionResult actionResult)
			: base(controller)
		{
			if (actionResult == null) throw new ArgumentNullException(Resources.ArgumentNullException);
			Result = actionResult;
		}

		public ResultExecutingContext(IController controller, IActionResult actionResult, bool cancel)
			: this(controller, actionResult)
		{
			this.Cancel = cancel;
		}

		#endregion Constructors

		#region Public Properties

		public bool Cancel
		{
			get; set;
		}

		public virtual IActionResult Result
		{
			get; set;
		}

		#endregion Public Properties
	}
}